<script>
	export default {
		name: "my-search"
	}
</script>
<script setup>
	const props = defineProps({
		bgcolor: {
			type: String,
			default: '#C00000'
		},
		rad: {
			type: Number,
			default: 15
		}
	})
	// 向外触发点击事件
	const emit = defineEmits(['click'])
	const dealSearchClick = () => emit('click')
</script>
<template>
	<view class="my-search-ctr" :style="{'background-color':props.bgcolor}" @click="dealSearchClick">
		<view class="my-search-box" :style="{'border-radius':props.rad+'px'}">
			<uni-icons type="search" size="20"></uni-icons>
			<text class="placeholder">输入搜索关键词...</text>
		</view>
	</view>
</template>


<style lang="scss">
	.my-search-ctr {
		height: 50px;
		// background-color: #C00000;
		display: flex;
		justify-content: center;
		flex-direction: column;
		padding: 0 8px;

		.my-search-box {
			height: 30px;
			background-color: white;
			// border-radius: 15px;
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: center;

			.placeholder {
				font-size: 16px;
				line-height: 30px;
				margin-left: 5px;
			}
		}
	}
</style>